package com.example.demo.infra.repository.impl;

import com.example.demo.api.dto.StudentGradeDTO;
import com.example.demo.app.repository.GradesRepository;
import com.example.demo.domain.entity.Grades;
import com.example.demo.domain.vo.StudentGradesSimpleVo;
import com.example.demo.infra.mapper.GradesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class GradesRepositoryImpl implements GradesRepository {
    @Autowired
    private GradesMapper gradesMapper;
    @Override
    public List<StudentGradeDTO> queryGradesByCondition(Integer studentId, Integer teacherId, Integer courseId) {
        return gradesMapper.selectGradesByCondition(studentId, teacherId, courseId);
    }

    @Override
    public Integer deleteByStudentIdInteger(List<Integer> ids) {
        return gradesMapper.deleteByStudentIdInteger(ids);
    }

    @Override
    public List<StudentGradesSimpleVo> queryStudentGradesSimple() {
        return gradesMapper.selectStudentGradesSimple();
    }

    @Override
    public Integer updateScore(Integer studentId, Integer courseId, Integer score) {
        return gradesMapper.updateScore(studentId,courseId,score);
    }
}
